﻿@model SampleApp.Web.SysModule.Models.RoleMenuListModel

@{
    Layout = null;
}

<div id="divList">
  <form id="roleMenuListForm">
    @Html.HiddenFor(m=>m.RoleID)
    <table>
        <tr>
            <th style="width:40px;text-align:left;">
                选择
            </th>
            <th style="width:180px;text-align:left;">
                菜单项
            </th>
            <th style="display:none;">
                ID
            </th>
        </tr>

       @for (var i = 0; i < Model.MenuList.Count; i++)
        {
            <tr>
                <td style="width:40px;text-align:left;">
                    <div style="display:@(Model.MenuList[i].IsParent ? "none" : "block")">@Html.CheckBoxFor(m => m.MenuList[i].IsSelected)</div>
                </td>
                <td style="width:80px;text-align:left;">
                    <div style="margin-left:@(Model.MenuList[i].IsParent?"0px":"20px")">@Html.DisplayFor(m => m.MenuList[i].MenuName)</div>
                </td>
                 <td style="display:none;">
                    @Html.HiddenFor(m => m.MenuList[i].MenuID)
                </td>
            </tr>
        }

    </table>
   </form>
</div>
